This is a responsive clone of the Nike homepage using only HTML and CSS.
View Nike Clone →Defined in the function declaration.
function greet(name) {
console.log("Hi " + name);
}
Actual values passed to the function call.
greet("Rahul"); // "Rahul" is the argument
let x = 5;
function show() {
console.log(x);
}
function test() {
let y = 10;
console.log(y);
}
console.log(y); // Error
Inner function accessing outer function’s variables after outer function is done.
function outer() {
let count = 0;
return function inner() {
count++;
console.log(count);
}
}
const inc = outer();
inc(); // 1
inc(); // 2